<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Tastick OJ - 更多工具</title>
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mdui@1.0.0/dist/css/mdui.min.css"/>
</head>
  <body class="mdui-theme-layout-auto">
    <div class="mdui-appbar mdui-container-fluid">
      <div class="mdui-toolbar mdui-color-theme">
        <a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon material-icons">menu</i></a>
        <a href="javascript:;" class="mdui-typo-headline">Tastick OJ</a>
        <a href="javascript:;" class="mdui-typo-title">更多工具&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</a>
        <a href="/help" class="mdui-btn"><b>帮助</b></a>
        <a href="/problem/list?page=1" class="mdui-btn"><b>题库</b></a>
        <a href="/talk" class="mdui-btn"><b>讨论</b></a>
        <a href="/tools" class="mdui-btn"><b>更多工具</b></a>
        <div class="mdui-toolbar-spacer"></div>
        <a href="/login" class="mdui-btn" id="denglu">登录</a>
      </div>
    </div><br><br>

    <div class="mdui-typo-display-2-opacity">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;更多工具</div>
    <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-deep-orange-900 mdui-container mdui-typo-display-2-opacity" style="height: 150px;" onclick="location.href='/online-idle'"><div class="mdui-typo-display-1-opacity">在线IDLE</div></button>
    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-amber-900 mdui-container mdui-typo-display-2-opacity" style="height: 150px;" onclick="location.href='/server-status'"><div class="mdui-typo-display-1-opacity">服务器状态</div></button>
    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-indigo-900 mdui-container mdui-typo-display-2-opacity" style="height: 150px;" onclick="location.href='/rank'"><div class="mdui-typo-display-1-opacity">排名</div></button>
    <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-green-900 mdui-container mdui-typo-display-2-opacity" style="height: 150px;" onclick="location.href='/back-stage'"><div class="mdui-typo-display-1-opacity">后台管理</div></button>


    <script>
      var httpRequest = new XMLHttpRequest();//第一步：建立所需的对象
        httpRequest.open('GET', '/whatsmyname', true);//第二步：打开连接  将请求参数写在url中  ps:"./Ptest.php?name=test&nameone=testone"
        httpRequest.send();//第三步：发送请求  将请求参数写在URL中
        /**
         * 获取数据后的处理程序
         */
        httpRequest.onreadystatechange = function () {
            if (httpRequest.readyState == 4 && httpRequest.status == 200) {
                var data = httpRequest.responseText;//获取到json字符串，还需解析
                console.log(data);
                if(data!='NeedLogin'){
                  document.getElementById('denglu').innerHTML=data;
                  document.getElementById('denglu').setAttribute("href","/me");
                }else{
                  mdui.snackbar({
  message: '请先登录（右上角）'
});
                }
            }else{
              return '失败！'
            }
        };

        function gotozuoti(){
          window.location.href="/problem/list?page=1";
        }
    </script>
  
<script src="//cdn.jsdelivr.net/npm/mdui@1.0.0/dist/js/mdui.min.js"></script>
<br><br><br><br><br><br><br>
</body>
</html>
